package com.stream.cloud.simple.service.web;

import com.stream.cloud.simple.service.model.UserEntity;
import com.stream.cloud.simple.service.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by yebaokang on 2017/10/31.
 */

@RestController

//@CommonsLog // Creates log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);
//@Log //   Creates log = java.util.logging.Logger.getLogger(LogExample.class.getName());
//@Log4j //  Creates log = org.apache.log4j.Logger.getLogger(LogExample.class);
//@Log4j2 // Creates log = org.apache.logging.log4j.LogManager.getLogger(LogExample.class);
//@XSlf4j // Creates log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
//@Slf4j //  Creates log = org.slf4j.LoggerFactory.getLogger(LogExample.class);

@Slf4j
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/user")
    public List<UserEntity> readUserInfo() {
        return userService.searchAll();
    }

    @GetMapping("/test")
    public String test() {
        return "Holle world";
    }
}

